var t = getApp(), e = 0, a = 0;

Page({
    data: {
        recordsList: [],
        activitys1: [],
        activitys2: [],
        showLoading: !1
    },
    onLoad: function(t) {
        this.getLive();
    },
    onReady: function() {},
    onShow: function() {},
    onImageError: function(t) {
        var e = t.target.dataset.index, a = t.target.dataset.seltype;
        this.onImageLoad({
            target: {
                dataset: {
                    index: e,
                    seltype: a
                }
            },
            detail: {
                width: 2340,
                height: 1080
            }
        });
    },
    gopage: function(t) {
        var e = t.currentTarget.dataset.id;
        wx.navigateTo({
            url: "/packageD/wxliveDetail/wxliveDetail?roomid=" + e
        });
    },
    getLive: function() {
        var e = this, a = t.getNetAddresss("plugin.appletslive.frontend.controllers.live.getRoom");
        t._getNetWork({
            url: a,
            success: function(t) {
                var a = t.data;
                1 == a.result ? e.setData({
                    recordsList: a.data
                }) : console.log(a.msg);
            },
            fail: function(t) {
                console.log(t);
            }
        });
    },
    onImageLoad: function(t) {
        var i, n = t.target.dataset.index, o = t.detail.width / t.detail.height;
        i = this.data.recordsList[n], this.imgCount += 1;
        var s = this.data.activitys1, r = this.data.activitys2;
        e <= a ? (e += 176 / o + 60, s.push(i)) : (a += 176 / o + 60, r.push(i));
        var d = {
            activitys1: s,
            activitys2: r
        };
        this.imgCount >= this.data.recordsList.length && this.setData({
            showLoading: !0
        }), this.setData(d);
    },
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareTimeline: function() {
        var t = wx.getStorageSync("yz_uid");
        return t && (mid = t), {
            title: "直播间列表",
            query: "mid=" + mid
        };
    },
    onShareAppMessage: function(t) {
        var e = wx.getStorageSync("yz_uid"), a = "";
        e && (a = e);
        return {
            title: "直播间列表",
            path: "/packageD/livePlayer/livePlayer?mid=" + a,
            success: function(t) {},
            fail: function(t) {}
        };
    }
});